//
//  Contains.h
//  BaseFramework01
//
//  Created by IMAC on 2017/5/26.
//  Copyright © 2017年 IMAC. All rights reserved.
//
#import "UIView+Layout.h"
#import <SDWebImage/UIImageView+WebCache.h>
#import "Api.h"
#import "UILabel+XZWObject.h"

/**********************************用户数据******************************************/
/**********************************数据存储******************************************/



/**********************************颜色******************************************/
//RBG color
#define RGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
#define RGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)];
#define RandColor [UIColor colorWithRed:arc4random() % 256 /255.0 green:arc4random() % 256 /255.0 blue:arc4random() % 256 /255.0 alpha:1]//随机色




/**********************************控制参数******************************************/

#define SCROLLVIEWHEIGHT 200//图轮高度

#define RECOMMENDCELLHEIGHT 100.0//推荐Cell高度
#define LIVECELLHEIGHT 90.0 //直播cell高度




/**********************************坐标尺寸类******************************************/
#define SCREEN_WIDTH                 ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT                ([[UIScreen mainScreen] bounds].size.height)
#define UI_TAB_BAR_HEIGHT 49

#define X(v)                    (v).frame.origin.x
#define Y(v)                    (v).frame.origin.y
#define WIDTH(v)                (v).frame.size.width
#define HEIGHT(v)               (v).frame.size.height

#define MinX(v)                 CGRectGetMinX((v).frame)
#define MinY(v)                 CGRectGetMinY((v).frame)

#define MidX(v)                 CGRectGetMidX((v).frame)
#define MidY(v)                 CGRectGetMidY((v).frame)

#define MaxX(v)                 CGRectGetMaxX((v).frame)
#define MaxY(v)                 CGRectGetMaxY((v).frame)



/**********************************设备版本类******************************************/
#define IOS7 ([[UIDevice currentDevice] systemVersion] floatValue] >= 7.f)
#define IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.f)
#define IOS9 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.f)
#define iOSVersion [[[UIDevice currentDevice] systemVersion] floatValue]//版本




/**********************************第三方Key类******************************************/



/**********************************其他******************************************/
//显示隐藏statusBar
#define SETSTATUSBARHIDDEN(isHidden)\
if (isHidden){\
[[UIApplication sharedApplication] setStatusBarHidden:YES];\
}else{\
[[UIApplication sharedApplication] setStatusBarHidden:NO];\
}

/**********************************判空类******************************************/
#define NOTNULL(x) ((![x isKindOfClass:[NSNull class]])&&x)
#define IS_NOT_EMPTY(string) (string !=nil && [string isKindOfClass:[NSString class]] && ![string isEqualToString:@""])//字符串不为空
#define ARRAY_IS_NOT_EMPTY(array) (array && [array isKindOfClass:[NSArray class]] && [array count])//数组不为空

#define SWNOTEmptyArr(X) (NOTNULL(X)&&[X isKindOfClass:[NSArray class]]&&[X count])
#define SWNOTEmptyDictionary(X) (NOTNULL(X)&&[X isKindOfClass:[NSDictionary class]]&&[[X allKeys]count])
#define SWNOTEmptyStr(X) (NOTNULL(X)&&[X isKindOfClass:[NSString class]]&&((NSString *)X).length)
#define SWToStr(X) [SingleCenterObj replaceNilStr:X nilStr:@""]



/**********************************字体类******************************************/
#define FONT_OF_SIZE(s) [UIFont systemFontOfSize:s]
